﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;

public partial class user_Default : System.Web.UI.Page
{
    string sql;
    protected void Page_Load(object sender, EventArgs e)
    {
        
        if (!this.IsPostBack)
        {
            if (Session.Contents["wj_User"] == null)
            {
                Response.Redirect("../uPassport.aspx");
            }
            else
            {
                bind_d();
                Areabig();
                txt_info();
                txt_One();
                txt_Two();
                txt_Three();
                bind_AreaOne();
                bind_AreaTwo();
                bind_AreaThree();
            }
        }
    }
    #region
    public void bind_d()//绑定大类
    {
        sql = "select * from Class where Menu_Level=1";
        DataTable dt = Class1.ExecSel(sql);
        this.dl_One.DataSource = dt;
        this.dl_One.DataTextField = "Menu_Name";
        this.dl_One.DataValueField = "Menu_ID";
        this.dl_One.DataBind();
    }

    protected void dl_One_SelectedIndexChanged(object sender, EventArgs e)
    {
        string ID = this.dl_One.SelectedValue;

        dl_Two.Items.Clear();
        dl_Two.Items.Add(new ListItem("全部", "0"));
        dl_Three.Items.Clear();
        dl_Three.Items.Add(new ListItem("全部", "0"));

        sql = "select * from Class where Menu_Level=2 and Menu_ParentLevel=" + ID;
        DataTable dt = Class1.ExecSel(sql);
        this.dl_Two.DataSource = dt;
        this.dl_Two.DataTextField = "Menu_Name";
        this.dl_Two.DataValueField = "Menu_ID";
        this.dl_Two.DataBind();

    }
    protected void dl_Two_SelectedIndexChanged(object sender, EventArgs e)
    {
        string ID = this.dl_Two.SelectedValue;

        dl_Three.Items.Clear();
        dl_Three.Items.Add(new ListItem("全部", "0"));

        sql = "select * from Class where Menu_Level=3 and Menu_ParentLevel=" + ID;
        DataTable dt = Class1.ExecSel(sql);
        dl_Three.DataSource = dt;
        dl_Three.DataValueField = "Menu_ID";
        dl_Three.DataTextField = "Menu_Name";
        dl_Three.DataBind();
    }
    public void Areabig()//地区大类
    {
        sql = "select * from Area where oneid<>0 and twoid=0 and threeid=0 order by sort";
        DataTable dt = Class1.ExecSel(sql);
        Ddl_AreaOne.DataSource = dt;
        Ddl_AreaOne.DataTextField = "areaname";
        Ddl_AreaOne.DataValueField = "oneid";
        Ddl_AreaOne.DataBind();
    }
    protected void Ddl_AreaOne_SelectedIndexChanged(object sender, EventArgs e)
    {
        Ddl_AreaTwo.Items.Clear();
        Ddl_AreaTwo.Items.Add(new ListItem("全部", "0"));
        Ddl_AreaThree.Items.Clear();
        Ddl_AreaThree.Items.Add(new ListItem("全部", "0"));

        sql = "select * from Area where twoid<>0 and threeid=0 and oneid=" + Ddl_AreaOne.SelectedValue + " order by sort";
        DataTable dt = Class1.ExecSel(sql);
        Ddl_AreaTwo.DataSource = dt;
        Ddl_AreaTwo.DataTextField = "areaname";
        Ddl_AreaTwo.DataValueField = "twoid";
        Ddl_AreaTwo.DataBind();
    }
    protected void Ddl_AreaTwo_SelectedIndexChanged(object sender, EventArgs e)
    {
        Ddl_AreaThree.Items.Clear();
        Ddl_AreaThree.Items.Add(new ListItem("全部", "0"));

        sql = "select * from Area where threeid<>0 and oneid=" + Ddl_AreaOne.SelectedValue;
        sql += " and twoid=" + Ddl_AreaTwo.SelectedValue + " order by sort";
        DataTable dt = Class1.ExecSel(sql);
        Ddl_AreaThree.DataSource = dt;
        Ddl_AreaThree.DataTextField = "areaname";
        Ddl_AreaThree.DataValueField = "threeid";
        Ddl_AreaThree.DataBind();
    }
    protected void UpImg_Click(object sender, EventArgs e)//上传图片
    {
        if (FileUpload1.PostedFile.ContentLength < 500000)//100000为100K
        {

            string fileFullname = this.FileUpload1.FileName;
            string dataName = DateTime.Now.ToString("yyyyMMddhhmmss");
            string fileName = fileFullname.Substring(fileFullname.LastIndexOf("\\") + 1);
            string type = fileFullname.Substring(fileFullname.LastIndexOf(".") + 1);
            if (type == "bmp" || type == "jpg" || type == "gif" || type == "JPG" || type == "BMP" || type == "GIF")
            {
                this.FileUpload1.SaveAs(Server.MapPath("../Images") + "\\" + dataName + "." + type);
                string ProImg = "Images/" + dataName + "." + type;
                this.txtLogoImg.Text = "Images/" + dataName + "." + type;
            }
            else
            {
                Response.Write("<script language='javascript'>alert('支持格式：|jpg|gif|bmp|');</script>");
            }
        }
        else
        {
            Response.Write("<script language='javascript'>alert('你的图片已经超过500K的大小！');</script>");
        }
    }
    #endregion

    #region
    public void info()
    {
        string Pattern1 = "";
        string Pattern2 = "";
        string Pattern3 = "";
        string Pattern4 = "";
        string CompanyName = txtCompany.Text;
        string LogoImg = txtLogoImg.Text;
        string C_One = dl_One.SelectedValue;
        string C_Two = dl_Two.SelectedValue;
        string C_Three = dl_Three.SelectedValue;
        string Direction = RadioButtonList1.SelectedValue;
        string Sale = txtSale.Text;
        string Buy = txtBuy.Text;

        if (this.CheckBox1.Checked)
        {
            Pattern1 = "生产型";

        }
        if (this.CheckBox2.Checked)
        {
            Pattern2 = "贸易型";

        }
        if (this.CheckBox3.Checked)
        {
            Pattern3 = "服务型";

        }
        if (this.CheckBox4.Checked)
        {
            Pattern4 = "政府或其他机构";

        }
        string Number = DropDownList1.SelectedItem.Text;
        string CompanyType = DropDownList2.SelectedItem.Text;
        string Content = txtContent.Text;
        string Connecter = txtConnecter.Text;
        string keywords = txtkeywords.Text;
        string Dept = txtDept.Text;
        string JobTitle = txtJobTitle.Text;
        string Phone = txtPhone.Text;
        string Fax = txtFax.Text;
        string Mobile = txtMobile.Text;
        string AreaOne = Ddl_AreaOne.SelectedValue;
        string AreaTwo = Ddl_AreaTwo.SelectedValue;
        string AreaThree = Ddl_AreaThree.SelectedValue;
        string Address = txtAddress.Text;
        string ZipCode = txtZipCode.Text;
        string Email = txtEmail.Text;
        string QQ = txtQQ.Text;
        string WebUrl = txtUrl.Text;

        string AreaA = Ddl_AreaOne.SelectedItem.Text;
        string AreaB = Ddl_AreaTwo.SelectedItem.Text;
        string AreaC = Ddl_AreaThree.SelectedItem.Text;
        int wj_true = 1;

        if (C_One == "0" && C_Two == "0" && C_Three == "0")
        {
            Response.Write("<script>alert('请选择一级分类！');history.go(-1);</script>");
            return;
        }
        else if (Number == "--请选择--")
        {
            Response.Write("<script>alert('请选择企业员工人数！');history.go(-1);</script>");
            return;
        }
        else if (CompanyType == "--请选择--")
        {
            Response.Write("<script>alert('请选择企业类型！');history.go(-1);</script>");
            return;
        }
        else if (QQ.Length>10)
        {
            Response.Write("<script>alert('QQ号码格式错误！');history.go(-1);</script>");
            return;
        }
        else
        {
            if (Session.Contents["wj_User"] == null)
            {
                Response.Redirect("uPassport.aspx");
            }
            else
            {
                string se_user = Session.Contents["wj_User"].ToString();
                string sql = "update wj_User set wj_CompanyName='" + CompanyName + "',wj_keywords='" + keywords + "', wj_LogoImg='" + LogoImg + "',C_One=" + C_One + ",C_Two=" + C_Two + ",C_Three=" + C_Three + ",wj_Direction='" + Direction + "',wj_Sale='" + Sale + "',wj_Buy='" + Buy + "',wj_Pattern1='" + Pattern1 + "', wj_Pattern2='" + Pattern2 + "',wj_Pattern3='" + Pattern3 + "',wj_Pattern4='" + Pattern4 + "',wj_Number='" + Number + "',wj_CompanyType='" + CompanyType + "',wj_Content='" + Content + "',wj_Connecter='" + Connecter + "',wj_Dept='" + Dept + "',wj_JobTitle='" + JobTitle + "',wj_Phone='" + Phone + "',wj_Fax='" + Fax + "',wj_Mobile='" + Mobile + "',AreaOne='" + AreaOne + "',AreaTwo='" + AreaTwo + "',AreaThree='" + AreaThree + "',wj_Address='" + Address + "',wj_ZipCode='" + ZipCode + "',wj_WebUrl='" + WebUrl + "',wj_Email='" + Email + "',AreaA='" + AreaA + "',AreaB='" + AreaB + "',AreaC='" + AreaC + "',wj_QQ='" + QQ + "',wj_true='" + wj_true + "' where wj_User='" + se_user + "'";
                Class1.ExecSql(sql);
                Class1.AlertShow("更新成功！", "uInformation.aspx");
            }
        }
    }
    protected void btnUpdateMemberInfo_Click(object sender, EventArgs e)
    {
        info();
    }
    #endregion

    #region
    public void txt_info()
    {
        if (Session.Contents["wj_User"] == null)
        {
            Response.Redirect("uPassport.aspx");
        }
        else
        {
            string se_user = Session.Contents["wj_User"].ToString();
            DataTable dt = Class1.ExecSel("select * from wj_User where wj_User='" + se_user + "'");
            txtCompany.Text = Convert.ToString(dt.Rows[0]["wj_CompanyName"]);
            txtLogoImg.Text = Convert.ToString(dt.Rows[0]["wj_LogoImg"]);
            txtkeywords.Text = Convert.ToString(dt.Rows[0]["wj_keywords"]);
            string Direction = RadioButtonList1.SelectedValue;

            if (dt.Rows[0]["wj_Direction"].ToString().Trim() == "销售")
            {
                this.RadioButtonList1.Items[0].Selected = true;
                this.RadioButtonList1.Items[1].Selected = false;
                this.RadioButtonList1.Items[2].Selected = false;
            }
            else if (dt.Rows[0]["wj_Direction"].ToString().Trim() == "采购")
            {
                this.RadioButtonList1.Items[0].Selected = false;
                this.RadioButtonList1.Items[1].Selected = true;
                this.RadioButtonList1.Items[2].Selected = false;
            }
            else if (dt.Rows[0]["wj_Direction"].ToString().Trim() == "两者都有")
            {
                this.RadioButtonList1.Items[0].Selected = false;
                this.RadioButtonList1.Items[1].Selected = false;
                this.RadioButtonList1.Items[2].Selected = true;
            }

            txtSale.Text = Convert.ToString(dt.Rows[0]["wj_Sale"]);
            txtBuy.Text = Convert.ToString(dt.Rows[0]["wj_Buy"]);

            if (dt.Rows[0]["wj_Pattern1"].ToString() == "生产型")
            {
                CheckBox1.Checked = true;
            }
            if (dt.Rows[0]["wj_Pattern2"].ToString() == "贸易型")
            {
                CheckBox2.Checked = true;
            }
            if (dt.Rows[0]["wj_Pattern3"].ToString() == "服务型")
            {
                CheckBox3.Checked = true;
            }
            if (dt.Rows[0]["wj_Pattern4"].ToString() == "政府或其他机构")
            {
                CheckBox4.Checked = true;
            }


            if (dt.Rows[0]["wj_Number"].ToString().Trim() == "5人以下")
            {
                this.DropDownList1.Items[0].Selected = false;
                this.DropDownList1.Items[1].Selected = true;
                this.DropDownList1.Items[2].Selected = false;
                this.DropDownList1.Items[3].Selected = false;
                this.DropDownList1.Items[4].Selected = false;
                this.DropDownList1.Items[5].Selected = false;
                this.DropDownList1.Items[6].Selected = false;
                this.DropDownList1.Items[7].Selected = false;
                this.DropDownList1.Items[8].Selected = false;
                this.DropDownList1.Items[9].Selected = false;
            }
            else if (dt.Rows[0]["wj_Number"].ToString().Trim() == "5-10人")
            {
                this.DropDownList1.Items[0].Selected = false;
                this.DropDownList1.Items[1].Selected = false;
                this.DropDownList1.Items[2].Selected = true;
                this.DropDownList1.Items[3].Selected = false;
                this.DropDownList1.Items[4].Selected = false;
                this.DropDownList1.Items[5].Selected = false;
                this.DropDownList1.Items[6].Selected = false;
                this.DropDownList1.Items[7].Selected = false;
                this.DropDownList1.Items[8].Selected = false;
                this.DropDownList1.Items[9].Selected = false;
            }
            else if (dt.Rows[0]["wj_Number"].ToString().Trim() == "11-50人")
            {
                this.DropDownList1.Items[0].Selected = false;
                this.DropDownList1.Items[1].Selected = false;
                this.DropDownList1.Items[2].Selected = false;
                this.DropDownList1.Items[3].Selected = true;
                this.DropDownList1.Items[4].Selected = false;
                this.DropDownList1.Items[5].Selected = false;
                this.DropDownList1.Items[6].Selected = false;
                this.DropDownList1.Items[7].Selected = false;
                this.DropDownList1.Items[8].Selected = false;
                this.DropDownList1.Items[9].Selected = false;
            }
            else if (dt.Rows[0]["wj_Number"].ToString().Trim() == "51-100人")
            {
                this.DropDownList1.Items[0].Selected = false;
                this.DropDownList1.Items[1].Selected = false;
                this.DropDownList1.Items[2].Selected = false;
                this.DropDownList1.Items[3].Selected = false;
                this.DropDownList1.Items[4].Selected = true;
                this.DropDownList1.Items[5].Selected = false;
                this.DropDownList1.Items[6].Selected = false;
                this.DropDownList1.Items[7].Selected = false;
                this.DropDownList1.Items[8].Selected = false;
                this.DropDownList1.Items[9].Selected = false;
            }
            else if (dt.Rows[0]["wj_Number"].ToString().Trim() == "101-200人")
            {
                this.DropDownList1.Items[0].Selected = false;
                this.DropDownList1.Items[1].Selected = false;
                this.DropDownList1.Items[2].Selected = false;
                this.DropDownList1.Items[3].Selected = false;
                this.DropDownList1.Items[4].Selected = false;
                this.DropDownList1.Items[5].Selected = true;
                this.DropDownList1.Items[6].Selected = false;
                this.DropDownList1.Items[7].Selected = false;
                this.DropDownList1.Items[8].Selected = false;
                this.DropDownList1.Items[9].Selected = false;
            }
            else if (dt.Rows[0]["wj_Number"].ToString().Trim() == "201-300人")
            {
                this.DropDownList1.Items[0].Selected = false;
                this.DropDownList1.Items[1].Selected = false;
                this.DropDownList1.Items[2].Selected = false;
                this.DropDownList1.Items[3].Selected = false;
                this.DropDownList1.Items[4].Selected = false;
                this.DropDownList1.Items[5].Selected = false;
                this.DropDownList1.Items[6].Selected = true;
                this.DropDownList1.Items[7].Selected = false;
                this.DropDownList1.Items[8].Selected = false;
                this.DropDownList1.Items[9].Selected = false;
            }
            else if (dt.Rows[0]["wj_Number"].ToString().Trim() == "301-500人")
            {
                this.DropDownList1.Items[0].Selected = false;
                this.DropDownList1.Items[1].Selected = false;
                this.DropDownList1.Items[2].Selected = false;
                this.DropDownList1.Items[3].Selected = false;
                this.DropDownList1.Items[4].Selected = false;
                this.DropDownList1.Items[5].Selected = false;
                this.DropDownList1.Items[6].Selected = false;
                this.DropDownList1.Items[7].Selected = true;
                this.DropDownList1.Items[8].Selected = false;
                this.DropDownList1.Items[9].Selected = false;
            }
            else if (dt.Rows[0]["wj_Number"].ToString().Trim() == "501-1000人")
            {
                this.DropDownList1.Items[0].Selected = false;
                this.DropDownList1.Items[1].Selected = false;
                this.DropDownList1.Items[2].Selected = false;
                this.DropDownList1.Items[3].Selected = false;
                this.DropDownList1.Items[4].Selected = false;
                this.DropDownList1.Items[5].Selected = false;
                this.DropDownList1.Items[6].Selected = false;
                this.DropDownList1.Items[7].Selected = false;
                this.DropDownList1.Items[8].Selected = true;
                this.DropDownList1.Items[9].Selected = false;
            }
            else if (dt.Rows[0]["wj_Number"].ToString().Trim() == "1000人以上")
            {
                this.DropDownList1.Items[0].Selected = false;
                this.DropDownList1.Items[1].Selected = false;
                this.DropDownList1.Items[2].Selected = false;
                this.DropDownList1.Items[3].Selected = false;
                this.DropDownList1.Items[4].Selected = false;
                this.DropDownList1.Items[5].Selected = false;
                this.DropDownList1.Items[6].Selected = false;
                this.DropDownList1.Items[7].Selected = false;
                this.DropDownList1.Items[8].Selected = false;
                this.DropDownList1.Items[9].Selected = true;
            }
            if (dt.Rows[0]["wj_CompanyType"].ToString().Trim() == "个体工商户")
            {
                this.DropDownList2.Items[0].Selected = false;
                this.DropDownList2.Items[1].Selected = true;
                this.DropDownList2.Items[2].Selected = false;
                this.DropDownList2.Items[3].Selected = false;
                this.DropDownList2.Items[4].Selected = false;
                this.DropDownList2.Items[5].Selected = false;
                this.DropDownList2.Items[6].Selected = false;
                this.DropDownList2.Items[7].Selected = false;
                this.DropDownList2.Items[8].Selected = false;
                this.DropDownList2.Items[9].Selected = false;
                this.DropDownList2.Items[10].Selected = false;
                this.DropDownList2.Items[11].Selected = false;
                this.DropDownList2.Items[12].Selected = false;
                this.DropDownList2.Items[13].Selected = false;
                this.DropDownList2.Items[14].Selected = false;
                this.DropDownList2.Items[15].Selected = false;
            }
            else if (dt.Rows[0]["wj_CompanyType"].ToString().Trim() == "私营独资企业")
            {
                this.DropDownList2.Items[0].Selected = false;
                this.DropDownList2.Items[1].Selected = false;
                this.DropDownList2.Items[2].Selected = true;
                this.DropDownList2.Items[3].Selected = false;
                this.DropDownList2.Items[4].Selected = false;
                this.DropDownList2.Items[5].Selected = false;
                this.DropDownList2.Items[6].Selected = false;
                this.DropDownList2.Items[7].Selected = false;
                this.DropDownList2.Items[8].Selected = false;
                this.DropDownList2.Items[9].Selected = false;
                this.DropDownList2.Items[10].Selected = false;
                this.DropDownList2.Items[11].Selected = false;
                this.DropDownList2.Items[12].Selected = false;
                this.DropDownList2.Items[13].Selected = false;
                this.DropDownList2.Items[14].Selected = false;
                this.DropDownList2.Items[15].Selected = false;
            }
            else if (dt.Rows[0]["wj_CompanyType"].ToString().Trim() == "私营有限责任公司")
            {
                this.DropDownList2.Items[0].Selected = false;
                this.DropDownList2.Items[1].Selected = false;
                this.DropDownList2.Items[2].Selected = false;
                this.DropDownList2.Items[3].Selected = true;
                this.DropDownList2.Items[4].Selected = false;
                this.DropDownList2.Items[5].Selected = false;
                this.DropDownList2.Items[6].Selected = false;
                this.DropDownList2.Items[7].Selected = false;
                this.DropDownList2.Items[8].Selected = false;
                this.DropDownList2.Items[9].Selected = false;
                this.DropDownList2.Items[10].Selected = false;
                this.DropDownList2.Items[11].Selected = false;
                this.DropDownList2.Items[12].Selected = false;
                this.DropDownList2.Items[13].Selected = false;
                this.DropDownList2.Items[14].Selected = false;
                this.DropDownList2.Items[15].Selected = false;
            }
            else if (dt.Rows[0]["wj_CompanyType"].ToString().Trim() == "私营股份有限公司")
            {
                this.DropDownList2.Items[0].Selected = false;
                this.DropDownList2.Items[1].Selected = false;
                this.DropDownList2.Items[2].Selected = false;
                this.DropDownList2.Items[3].Selected = false;
                this.DropDownList2.Items[4].Selected = true;
                this.DropDownList2.Items[5].Selected = false;
                this.DropDownList2.Items[6].Selected = false;
                this.DropDownList2.Items[7].Selected = false;
                this.DropDownList2.Items[8].Selected = false;
                this.DropDownList2.Items[9].Selected = false;
                this.DropDownList2.Items[10].Selected = false;
                this.DropDownList2.Items[11].Selected = false;
                this.DropDownList2.Items[12].Selected = false;
                this.DropDownList2.Items[13].Selected = false;
                this.DropDownList2.Items[14].Selected = false;
                this.DropDownList2.Items[15].Selected = false;
            }
            else if (dt.Rows[0]["wj_CompanyType"].ToString().Trim() == "国有企业")
            {
                this.DropDownList2.Items[0].Selected = false;
                this.DropDownList2.Items[1].Selected = false;
                this.DropDownList2.Items[2].Selected = false;
                this.DropDownList2.Items[3].Selected = false;
                this.DropDownList2.Items[4].Selected = false;
                this.DropDownList2.Items[5].Selected = true;
                this.DropDownList2.Items[6].Selected = false;
                this.DropDownList2.Items[7].Selected = false;
                this.DropDownList2.Items[8].Selected = false;
                this.DropDownList2.Items[9].Selected = false;
                this.DropDownList2.Items[10].Selected = false;
                this.DropDownList2.Items[11].Selected = false;
                this.DropDownList2.Items[12].Selected = false;
                this.DropDownList2.Items[13].Selected = false;
                this.DropDownList2.Items[14].Selected = false;
                this.DropDownList2.Items[15].Selected = false;
            }
            else if (dt.Rows[0]["wj_CompanyType"].ToString().Trim() == "集体企业")
            {
                this.DropDownList2.Items[0].Selected = false;
                this.DropDownList2.Items[1].Selected = false;
                this.DropDownList2.Items[2].Selected = false;
                this.DropDownList2.Items[3].Selected = false;
                this.DropDownList2.Items[4].Selected = false;
                this.DropDownList2.Items[5].Selected = false;
                this.DropDownList2.Items[6].Selected = true;
                this.DropDownList2.Items[7].Selected = false;
                this.DropDownList2.Items[8].Selected = false;
                this.DropDownList2.Items[9].Selected = false;
                this.DropDownList2.Items[10].Selected = false;
                this.DropDownList2.Items[11].Selected = false;
                this.DropDownList2.Items[12].Selected = false;
                this.DropDownList2.Items[13].Selected = false;
                this.DropDownList2.Items[14].Selected = false;
                this.DropDownList2.Items[15].Selected = false;
            }
            else if (dt.Rows[0]["wj_CompanyType"].ToString().Trim() == "股份合作企业")
            {
                this.DropDownList2.Items[0].Selected = false;
                this.DropDownList2.Items[1].Selected = false;
                this.DropDownList2.Items[2].Selected = false;
                this.DropDownList2.Items[3].Selected = false;
                this.DropDownList2.Items[4].Selected = false;
                this.DropDownList2.Items[5].Selected = false;
                this.DropDownList2.Items[6].Selected = false;
                this.DropDownList2.Items[7].Selected = true;
                this.DropDownList2.Items[8].Selected = false;
                this.DropDownList2.Items[9].Selected = false;
                this.DropDownList2.Items[10].Selected = false;
                this.DropDownList2.Items[11].Selected = false;
                this.DropDownList2.Items[12].Selected = false;
                this.DropDownList2.Items[13].Selected = false;
                this.DropDownList2.Items[14].Selected = false;
                this.DropDownList2.Items[15].Selected = false;
            }
            else if (dt.Rows[0]["wj_CompanyType"].ToString().Trim() == "联营企业")
            {
                this.DropDownList2.Items[0].Selected = false;
                this.DropDownList2.Items[1].Selected = false;
                this.DropDownList2.Items[2].Selected = false;
                this.DropDownList2.Items[3].Selected = false;
                this.DropDownList2.Items[4].Selected = false;
                this.DropDownList2.Items[5].Selected = false;
                this.DropDownList2.Items[6].Selected = false;
                this.DropDownList2.Items[7].Selected = false;
                this.DropDownList2.Items[8].Selected = true;
                this.DropDownList2.Items[9].Selected = false;
                this.DropDownList2.Items[10].Selected = false;
                this.DropDownList2.Items[11].Selected = false;
                this.DropDownList2.Items[12].Selected = false;
                this.DropDownList2.Items[13].Selected = false;
                this.DropDownList2.Items[14].Selected = false;
                this.DropDownList2.Items[15].Selected = false;
            }
            else if (dt.Rows[0]["wj_CompanyType"].ToString().Trim() == "国有独资公司")
            {
                this.DropDownList2.Items[0].Selected = false;
                this.DropDownList2.Items[1].Selected = false;
                this.DropDownList2.Items[2].Selected = false;
                this.DropDownList2.Items[3].Selected = false;
                this.DropDownList2.Items[4].Selected = false;
                this.DropDownList2.Items[5].Selected = false;
                this.DropDownList2.Items[6].Selected = false;
                this.DropDownList2.Items[7].Selected = false;
                this.DropDownList2.Items[8].Selected = false;
                this.DropDownList2.Items[9].Selected = true;
                this.DropDownList2.Items[10].Selected = false;
                this.DropDownList2.Items[11].Selected = false;
                this.DropDownList2.Items[12].Selected = false;
                this.DropDownList2.Items[13].Selected = false;
                this.DropDownList2.Items[14].Selected = false;
                this.DropDownList2.Items[15].Selected = false;
            }
            else if (dt.Rows[0]["wj_CompanyType"].ToString().Trim() == "其他有限责任公司")
            {
                this.DropDownList2.Items[0].Selected = false;
                this.DropDownList2.Items[1].Selected = false;
                this.DropDownList2.Items[2].Selected = false;
                this.DropDownList2.Items[3].Selected = false;
                this.DropDownList2.Items[4].Selected = false;
                this.DropDownList2.Items[5].Selected = false;
                this.DropDownList2.Items[6].Selected = false;
                this.DropDownList2.Items[7].Selected = false;
                this.DropDownList2.Items[8].Selected = false;
                this.DropDownList2.Items[9].Selected = false;
                this.DropDownList2.Items[10].Selected = true;
                this.DropDownList2.Items[11].Selected = false;
                this.DropDownList2.Items[12].Selected = false;
                this.DropDownList2.Items[13].Selected = false;
                this.DropDownList2.Items[14].Selected = false;
                this.DropDownList2.Items[15].Selected = false;
            }
            else if (dt.Rows[0]["wj_CompanyType"].ToString().Trim() == "股份有限公司")
            {
                this.DropDownList2.Items[0].Selected = false;
                this.DropDownList2.Items[1].Selected = false;
                this.DropDownList2.Items[2].Selected = false;
                this.DropDownList2.Items[3].Selected = false;
                this.DropDownList2.Items[4].Selected = false;
                this.DropDownList2.Items[5].Selected = false;
                this.DropDownList2.Items[6].Selected = false;
                this.DropDownList2.Items[7].Selected = false;
                this.DropDownList2.Items[8].Selected = false;
                this.DropDownList2.Items[9].Selected = false;
                this.DropDownList2.Items[10].Selected = false;
                this.DropDownList2.Items[11].Selected = true;
                this.DropDownList2.Items[12].Selected = false;
                this.DropDownList2.Items[13].Selected = false;
                this.DropDownList2.Items[14].Selected = false;
                this.DropDownList2.Items[15].Selected = false;
            }
            else if (dt.Rows[0]["wj_CompanyType"].ToString().Trim() == "其他内资企业")
            {
                this.DropDownList2.Items[0].Selected = false;
                this.DropDownList2.Items[1].Selected = false;
                this.DropDownList2.Items[2].Selected = false;
                this.DropDownList2.Items[3].Selected = false;
                this.DropDownList2.Items[4].Selected = false;
                this.DropDownList2.Items[5].Selected = false;
                this.DropDownList2.Items[6].Selected = false;
                this.DropDownList2.Items[7].Selected = false;
                this.DropDownList2.Items[8].Selected = false;
                this.DropDownList2.Items[9].Selected = false;
                this.DropDownList2.Items[10].Selected = false;
                this.DropDownList2.Items[11].Selected = false;
                this.DropDownList2.Items[12].Selected = true;
                this.DropDownList2.Items[13].Selected = false;
                this.DropDownList2.Items[14].Selected = false;
                this.DropDownList2.Items[15].Selected = false;
            }
            else if (dt.Rows[0]["wj_CompanyType"].ToString().Trim() == "中外合资经营")
            {
                this.DropDownList2.Items[0].Selected = false;
                this.DropDownList2.Items[1].Selected = false;
                this.DropDownList2.Items[2].Selected = false;
                this.DropDownList2.Items[3].Selected = false;
                this.DropDownList2.Items[4].Selected = false;
                this.DropDownList2.Items[5].Selected = false;
                this.DropDownList2.Items[6].Selected = false;
                this.DropDownList2.Items[7].Selected = false;
                this.DropDownList2.Items[8].Selected = false;
                this.DropDownList2.Items[9].Selected = false;
                this.DropDownList2.Items[10].Selected = false;
                this.DropDownList2.Items[11].Selected = false;
                this.DropDownList2.Items[12].Selected = false;
                this.DropDownList2.Items[13].Selected = true;
                this.DropDownList2.Items[14].Selected = false;
                this.DropDownList2.Items[15].Selected = false;
            }
            else if (dt.Rows[0]["wj_CompanyType"].ToString().Trim() == "中外合作经营")
            {
                this.DropDownList2.Items[0].Selected = false;
                this.DropDownList2.Items[1].Selected = false;
                this.DropDownList2.Items[2].Selected = false;
                this.DropDownList2.Items[3].Selected = false;
                this.DropDownList2.Items[4].Selected = false;
                this.DropDownList2.Items[5].Selected = false;
                this.DropDownList2.Items[6].Selected = false;
                this.DropDownList2.Items[7].Selected = false;
                this.DropDownList2.Items[8].Selected = false;
                this.DropDownList2.Items[9].Selected = false;
                this.DropDownList2.Items[10].Selected = false;
                this.DropDownList2.Items[11].Selected = false;
                this.DropDownList2.Items[12].Selected = false;
                this.DropDownList2.Items[13].Selected = false;
                this.DropDownList2.Items[14].Selected = true;
                this.DropDownList2.Items[15].Selected = false;
            }
            else if (dt.Rows[0]["wj_CompanyType"].ToString().Trim() == "外商独资")
            {
                this.DropDownList2.Items[0].Selected = false;
                this.DropDownList2.Items[1].Selected = false;
                this.DropDownList2.Items[2].Selected = false;
                this.DropDownList2.Items[3].Selected = false;
                this.DropDownList2.Items[4].Selected = false;
                this.DropDownList2.Items[5].Selected = false;
                this.DropDownList2.Items[6].Selected = false;
                this.DropDownList2.Items[7].Selected = false;
                this.DropDownList2.Items[8].Selected = false;
                this.DropDownList2.Items[9].Selected = false;
                this.DropDownList2.Items[10].Selected = false;
                this.DropDownList2.Items[11].Selected = false;
                this.DropDownList2.Items[12].Selected = false;
                this.DropDownList2.Items[13].Selected = false;
                this.DropDownList2.Items[14].Selected = false;
                this.DropDownList2.Items[15].Selected = true;
            }
            txtContent.Text = Convert.ToString(dt.Rows[0]["wj_Content"]);
            txtConnecter.Text = Convert.ToString(dt.Rows[0]["wj_Connecter"]);
            txtDept.Text = Convert.ToString(dt.Rows[0]["wj_Dept"]);
            txtJobTitle.Text = Convert.ToString(dt.Rows[0]["wj_JobTitle"]);
            txtPhone.Text = Convert.ToString(dt.Rows[0]["wj_Phone"]);
            txtFax.Text = Convert.ToString(dt.Rows[0]["wj_Phone"]);
            txtMobile.Text = Convert.ToString(dt.Rows[0]["wj_Mobile"]);
            txtAddress.Text = Convert.ToString(dt.Rows[0]["wj_Address"]);
            txtZipCode.Text = Convert.ToString(dt.Rows[0]["wj_ZipCode"]);
            txtEmail.Text = Convert.ToString(dt.Rows[0]["wj_Email"]);
            txtUrl.Text = Convert.ToString(dt.Rows[0]["wj_WebUrl"]);
            txtQQ.Text = Convert.ToString(dt.Rows[0]["wj_QQ"]);
        }
    }
    #endregion

    #region 产品分类
    public void txt_One()//绑定大类
    {
        string se_user = Session.Contents["wj_User"].ToString().Trim();
        DataTable dt = Class1.ExecSel("select * from wj_User where wj_User='" + se_user + "'");
        Session["dl"] = Convert.ToString(dt.Rows[0]["C_One"].ToString());

        sql = "select * from Class where Menu_Level=1";
        DataTable dt2 = Class1.ExecSel(sql);
        this.dl_One.DataSource = dt2;
        this.dl_One.DataTextField = "Menu_Name";
        this.dl_One.DataValueField = "Menu_ID";
        this.dl_One.SelectedValue = Session["dl"].ToString();
        this.dl_One.DataBind();
    }
    public void txt_Two()//绑定中类
    {
        string se_user = Session.Contents["wj_User"].ToString();
        DataTable dt = Class1.ExecSel("select * from wj_User where wj_User='" + se_user + "'");
        Session["zl"] = Convert.ToString(dt.Rows[0]["C_Two"].ToString());

        sql = "select * from Class where  Menu_ParentLevel=" + this.dl_One.SelectedValue;
        DataTable dt2 = Class1.ExecSel(sql);
        this.dl_Two.DataSource = dt2;
        this.dl_Two.DataTextField = "Menu_Name";
        this.dl_Two.DataValueField = "Menu_ID";
        this.dl_Two.SelectedValue = Session["zl"].ToString();
        this.dl_Two.DataBind();
    }
    public void txt_Three()//绑定小类
    {
        string se_user = Session.Contents["wj_User"].ToString();
        DataTable dt = Class1.ExecSel("select * from wj_User where wj_User='" + se_user + "'");
        Session["xl"] = Convert.ToString(dt.Rows[0]["C_Three"].ToString());

        sql = "select * from Class where Menu_ParentLevel=" + this.dl_Two.SelectedValue;
        DataTable dt2 = Class1.ExecSel(sql);
        this.dl_Three.DataSource = dt2;
        this.dl_Three.DataTextField = "Menu_Name";
        this.dl_Three.DataValueField = "Menu_ID";
        this.dl_Three.SelectedValue = Session["xl"].ToString();
        this.dl_Three.DataBind();
    }
    #endregion

    #region 省市
    public void bind_AreaOne()//绑定省
    {
        string se_user = Session.Contents["wj_User"].ToString();
        DataTable dt = Class1.ExecSel("select * from wj_User where wj_User='" + se_user + "'");
        Session["dl"] = Convert.ToString(dt.Rows[0]["AreaOne"].ToString());

        sql = "select * from Area where oneid<>0 and twoid=0 and threeid=0 order by sort";
        DataTable dt2 = Class1.ExecSel(sql);
        this.Ddl_AreaOne.DataSource = dt2;
        this.Ddl_AreaOne.DataTextField = "areaname";
        this.Ddl_AreaOne.DataValueField = "oneid";
        this.Ddl_AreaOne.SelectedValue = Session["dl"].ToString();
        this.Ddl_AreaOne.DataBind();
    }
    public void bind_AreaTwo()//绑定市
    {
        string se_user = Session.Contents["wj_User"].ToString();
        DataTable dt = Class1.ExecSel("select * from wj_User where wj_User='" + se_user + "'");
        Session["zl"] = Convert.ToString(dt.Rows[0]["AreaTwo"].ToString());

        sql = "select * from Area where twoid<>0 and threeid=0 and oneid=" + Ddl_AreaOne.SelectedValue + " order by sort";
        DataTable dt2 = Class1.ExecSel(sql);
        this.Ddl_AreaTwo.DataSource = dt2;
        this.Ddl_AreaTwo.DataTextField = "areaname";
        this.Ddl_AreaTwo.DataValueField = "twoid";
        this.Ddl_AreaTwo.SelectedValue = Session["zl"].ToString();
        this.Ddl_AreaTwo.DataBind();
    }
    public void bind_AreaThree()//绑定城市
    {
        string se_user = Session.Contents["wj_User"].ToString();
        DataTable dt = Class1.ExecSel("select * from wj_User where wj_User='" + se_user + "'");
        Session["xl"] = Convert.ToString(dt.Rows[0]["AreaThree"].ToString());

        sql = "select * from Area where threeid<>0 and oneid=" + Ddl_AreaOne.SelectedValue;
        sql += " and twoid=" + Ddl_AreaTwo.SelectedValue + " order by sort";
        DataTable dt2 = Class1.ExecSel(sql);
        this.Ddl_AreaThree.DataSource = dt2;
        this.Ddl_AreaThree.DataTextField = "areaname";
        this.Ddl_AreaThree.DataValueField = "threeid";
        this.Ddl_AreaThree.SelectedValue = Session["xl"].ToString();
        this.Ddl_AreaThree.DataBind();
    }
    #endregion
}
